package com.econ.powercloud.ems.common.enums;

/**
 * @Author : zjf
 * @Description :
 * @Date : 2022/1/12 9:54
 * @Modified by : zjf
 */
public enum RemoteType {
    YK(1, "遥控"),
    YT(2, "遥调"),
    ;

    private Integer code;
    private String desc;

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    RemoteType(int code, String desc){
        this.code=code;
        this.desc=desc;
    }

    public static RemoteType fromCode(int code){
        for(RemoteType type: RemoteType.values()){
            if(type.getCode() == code){
                return type;
            }
        }
        return YK;
    }

    public static String getDescFromCode(int code){
        for(RemoteType type: RemoteType.values()){
            if(type.getCode() == code){
                return type.getDesc();
            }
        }
        return null;
    }

}
